<template>
  <div class="container">
    <img
      src="../assets/sekiro+concept+art+pixel+life+stories+(30).jpg"
      alt=""
    />
    <div class="des" @click="ck" :style="{ backgroundColor: colorStr }">
      这是一个孤独可怜的猩猩
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      colorStr: "white",
    };
  },
  methods: {
    ck() {
      this.colorStr = `rgb(${Math.floor(Math.random() * 256)},${Math.floor(
        Math.random() * 256
      )},${Math.floor(Math.random() * 256)})`;
    },
  },
};
</script>

<style>
.des {
  height: 50px;
  text-align: center;
  line-height: 50px;
}
img {
  width: 100%;
}
.container {
  display: inline-block;
  width: 400px;
  border: 1px solid black;
}
</style>